from django.db import models

# Create your models here.


class Trajec(models.Model):
    uid = models.IntegerField(primary_key=True)

    uuid = models.CharField(verbose_name='UUID', max_length=100)
    vehicle_type = models.CharField(verbose_name='出行方式', max_length=32)
    start_time = models.DateTimeField(verbose_name='开始时间', auto_now=False)
    start_pos = models.CharField(verbose_name='起始地点', max_length=128)
    end_time = models.DateTimeField(verbose_name='结束时间', auto_now=False)
    end_pos = models.CharField(verbose_name='结束地点', max_length=128)

    trajectory = models.TextField(verbose_name='轨迹')

    dis = models.FloatField(verbose_name='里程',default=0.0)
    run_time = models.FloatField(verbose_name='行驶时间',default=0.0)
    aver_vel = models.FloatField(verbose_name='平均速度',default=0.0)
    

    class Meta:
        verbose_name = "出行记录"
        verbose_name_plural = verbose_name

    def __str__(self):
        return str(self.uid)


class TrajecCal(models.Model):
    uid = models.IntegerField(primary_key=True)
    uuid = models.CharField(verbose_name='UUID', max_length=100)

    trajectory_cal = models.TextField(verbose_name='计算轨迹')

    

    class Meta:
        verbose_name = "计算轨迹"
        verbose_name_plural = verbose_name

    def __str__(self):
        return str(self.uid)